import Vue from "vue";
import VueWorker from 'vue-worker';
import Vuex from 'vuex';
// import Axios from "axios";
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from "./App.vue";
import router from "./router";
import mavonEditor from 'mavon-editor'
import CodeDiff from 'vue-code-diff'
import 'mavon-editor/dist/css/index.css'
import '@/assets/app.css'
import $ from 'jquery'
// import 'bootstrap'
// import 'bootstrap/dist/css/bootstrap.min.css'
// import 'bootstrap/dist/js/bootstrap.min.js'

// import Buefy from 'buefy'
// import 'buefy/dist/buefy.css'

// import relativeTime from 'dayjs/plugin/relativeTime';
// import 'dayjs/locale/zh-cn'
// const dayjs = require('dayjs');

// // 相对时间插件
// dayjs.extend(relativeTime)

// dayjs.locale('zh-cn') // use locale globally
// dayjs().locale('zh-cn').format() // use locale in a specific instance

// Vue.prototype.dayjs = dayjs;//可以全局使用dayjs

Vue.use(ElementUI);
Vue.use(VueWorker);
Vue.use(Vuex);
Vue.use(mavonEditor)

// Vue.use(Buefy)
Vue.use(CodeDiff)
// Vue.use(Axios)

// 生产环境提示
Vue.config.productionTip = false;

const store = new Vuex.Store({

  state: {
      token: ''
  },

  mutations: {
      SET_TOKEN: (state, token) => {
          state.token = token
          localStorage.setItem("token", token)
      },

      RESET_STATE: (state) => {
        state.token = ''
      }
  },

  actions: {

  },

  modules: {

  }

  
})

// new Vue({
//   router,
//   render: h => h(App)
// }).$mount("#app");

new Vue({
  el: '#app',
  store: store,
  router,
  template: "<App/>",
  // components: {
  //   App
  // },
  render: h => h(App)
}).$mount("#app");